package com.hzeport.bgs22emduty.enums;

import com.fasterxml.jackson.annotation.JsonValue;

import java.util.HashMap;
import java.util.Map;

public enum  DutyScheduleSetCustomRecordStatusEnum implements BaseEnum{

    IS_PASSED("1","已经使用"), NOT_PASSED_YET("2","尚未使用完"),
    NOT_USE("3","未使用");
    private String code;
    private String description;
    DutyScheduleSetCustomRecordStatusEnum(){};
    DutyScheduleSetCustomRecordStatusEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }
    @Override
    public String toString() {
        return this.getValue();
    }
    @Override
    public String getValue() {
        return code;
    }

    @Override
    public  BaseEnum getEnum(String value) {
        for(BaseEnum v : values())
            if(v.getValue().equalsIgnoreCase(value)) return v;
        throw new IllegalArgumentException();
    }
    public Map<String,Object> toMap(){
        Map<String,Object> map = new HashMap<>();
        map.put("code",getValue());
        map.put("description ",getDescription());
        return map;
    }

    @JsonValue
    public String getDescription() {
        return description;
    }
}
